-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable setting multipart to true/false by defining it as a custom client context parameter #4903
Conversation
…ent context parameter
...anager/src/main/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerFactory.java
Show resolved
Hide resolved
@@ -271,6 +270,10 @@ | |||
"CrossRegionAccessEnabled":{ | |||
"documentation":"Enables cross-region bucket access for this client", | |||
"type":"boolean" | |||
}, | |||
"multipartEnabled":{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also adds the multipart-enable config and method to the sync version of the client, as it adds the method the S3BaseClientBuilder
interface which is used by both the sync and async builders:
S3Client client = S3Client.builder()
.multipartEnabled(true) // <--- should not be available on sync builder
.build();
I think we should avoid being able to define this config on the sync client and keep it on the async client only
...anager/src/main/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerFactory.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerLoggingTest.java
Outdated
Show resolved
Hide resolved
…long with multi-part
+ ".MultipartS3AsyncClient")) { | ||
log.debug(() -> "The provided S3AsyncClient is neither an instance of S3CrtAsyncClient or MultipartS3AsyncClient, " + | ||
"and thus multipart upload/download feature may not be enabled and resumable file upload may not " + | ||
"be supported.\n" + "To benefit from maximum throughput, consider using S3AsyncClient.crtBuilder().build() " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nit-picky: I'd avoid \n in logs
There seems to still be a checkstyle violation:
|
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Multipart upload can be set as a client configuration parameter and is accessible at the time of instantiation. This allows classes that instantiate the S3AsyncClient to validate this parameter.
Modifications
1)Incorporated multiPartEnabled as a custom client configuration parameter by defining it in customization.config. The codegen module generates getter and setter methods for this parameter.
2) By default, set multipartEnabled = true in the S3AsyncClient
3) Removed code that sets multiPart Enabled on the client directly
Testing
Unit Tests to validate that
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License